import defaultOption from '@/const/crud/defaultOption'


export function initListTableOption() {
    const listTableOption = {
        index: true,
        delBtn: true,
        menu: true,
        column: [
            {
                label: "参数名",
                width: 200,
                prop: "1",
                slot: true,
                headerslot: true,
            },
            {
                label: "参数说明",
                prop: "2",
                headerslot: true,
            },
            {
                label: "参数类型",
                prop: "3",
                headerslot: true,
            },
            {
                label: "映射参数名",
                width: 150,
                prop: "4",
                slot: true,
                headerslot: true,
            },
            {
                label: "来源类型",
                prop: "5",
                slot: true,
                headerslot: true,
            },
            {
                label: "默认值",
                width: 120,
                prop: "6",
                slot: true,
                headerslot: true,
            },
            {
                label: "是否序列",
                prop: "7",
                width: 150,
                headerslot: true,
            },
            {
                label: "序列名",
                prop: "8",
                slot: true,
                headerslot: true,
            },
            {
                width: 160,
                label: "是否自动编号",
                prop: "9",
                slot: true,
                headerslot: true,
            },
            {
                label: "自动编号名",
                width: 120,
                prop: "10",
                slot: true,
                headerslot: true,
            },
            {
                label: "是否从父节点取值",
                prop: "11",
                width: 150,
                headerslot: true,
            },
            {
                label: "从父节点取值参数",
                prop: "12",
                width: 150,
                headerslot: true,
            },
            {
                label: "是否作为更新条件",
                prop: "13",
                width: 150,
                headerslot: true,
            },
            {
                label: "是否返回参数值",
                prop: "14",
                width: 150,
                headerslot: true,
            },
            {
                label: "参数是否必填",
                prop: "15",
                width: 150,
                headerslot: true,
            },
        ]
    }
    return defaultOption(listTableOption, 'defaultListTableOption')
}
export function initFormOption() {
    const formOption = {
        labelWidth: 180,
        submitBtn: true,   // 提交按钮
        submitText: "测试数据库连接",
        column: [
            {
                span: 8,
                label: '服务编号',
                prop: 'a',
                type: 'input'
            },
            {
                span: 8,
                label: '接口格式(mson):XML',
                prop: 'b',
                type: 'select',

                dicData: [{
                    value: 'XML',
                    label: 'XML'
                },
                {
                    value: '2',
                    label: '2'
                }],
            },
            {
                span: 8,
                label: '数据库URL',
                prop: 'czxc',

            },
            {
                span: 8,
                label: '服务名',
                prop: 'cas',

            },
            {
                span: 8,
                label: '接口上传数据加密方式',
                prop: 'czb',
                type: 'select',
                dicData: [{
                    value: 'XML',
                    label: 'XML'
                },
                {
                    value: '2',
                    label: '2'
                }],
            },
            {
                span: 8,
                label: '数据库用户名',
                prop: 'fghc',

            },
            {
                span: 8,
                label: '服务类',
                prop: 'fgh',

            },
            {
                span: 8,
                label: '是否记录接口日志',
                prop: 'gfgh',
                type: 'select',
                dicData: [{
                    value: '是',
                    label: '是'
                },
                {
                    value: '否',
                    label: '否'
                }],
            },
            {
                span: 8,
                label: '数据库密码',
                prop: 'asdc',

            },
            {
                span: 8,
                label: '服务说明',
                prop: 'c'
            },
            {
                span: 8,
                label: '是否启用',
                prop: 'nzxc',
                type: 'select',
                dicData: [{
                    value: '是',
                    label: '是'
                },
                {
                    value: '否',
                    label: '否'
                }],
            },

        ]
    }
    return formOption
}


export function initListoption(companyId) {
    const listTableOption = {
        editBtn: true, // 表格修改按钮
        delBtn: true,  // 表格删除按钮
        menuWidth: 200, // 操作栏宽度
        defaultSort: {
            prop: 'id',
            order: 'descending'
        },
        column: [
            {
                label: '流水号',
                prop: 'id',
                sortable: true,
                headerslot: true,
            },
            {
                label: '测试12',
                prop: 'd',
                headerslot: true,
            },
            {
                label: '测试1223',
                prop: 'b',
                headerslot: true,
            },
            {
                label: '测试9',
                prop: 'c',
                headerslot: true,
            },
            {
                label: '测试122',
                prop: 'e',
                headerslot: true,
            },
        ]
    }
    return defaultOption(listTableOption, 'defaultListTableOption')
}
export function initlistFormOption(companyId) {

    //车辆查询的查询条件配置
    const listFormOption = {
        labelWidth: 140,
        column: [
            {
                label: "测试121",
                prop: "model_id",
                headerslot: true,
            },
            {
                label: "测试126",
                prop: "model_desc",
                headerslot: true,
            },
            {
                label: "测试1212",
                prop: "model_status",
            },
            {
                label: "测试127",
                prop: "create_date",
                headerslot: true,
            },
        ]
    }
    return defaultOption(listFormOption, 'defaultListFormOption')
}




